<!--
 * 用户 查询器
 * :
 * @version: 1.0
 * @author: lakeside hubin_yuan.410@hotmail.com
 * @date: 20120-07-14
 * @LastEditors:
 * @LastEditTime:
 -->
<template>
  <el-form ref="userSearchForm" :model="search.criteria" :rules="rules" label-position="right" label-width="6rem">
    <el-row justify="center" type="flex"><span class="p-1 span_tag">需要根据索引调整可支持的查询字段</span></el-row>
    <el-row>
      <el-col :lg="12" :md="24">
        <el-form-item label="通用搜索" prop="remarkNote">
          <el-input v-model="search.criteria.filter" autocomplete="off" clearable
                    placeholder="支持【空】模糊搜索"></el-input>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <el-col :lg="12" :md="24">
        <el-form-item label="头像" prop="avatarUrl">
          <el-input v-model="search.criteria.avatarUrl"
                    autocomplete="off" placeholder=""></el-input>
        </el-form-item>
      </el-col>
      <el-col :lg="12" :md="24">
        <el-form-item label="身份证号" prop="cardId">
          <el-input v-model="search.criteria.cardId"
                    autocomplete="off" placeholder=""></el-input>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <el-col :lg="12" :md="24">
        <el-form-item label="邮箱" prop="email">
          <el-input v-model="search.criteria.email"
                    autocomplete="off" placeholder=""></el-input>
        </el-form-item>
      </el-col>
      <el-col :lg="12" :md="24">
        <el-form-item label="失效时间" prop="expiredTime">
          <el-date-picker v-model="search.criteria.expiredTime" align="l" end-placeholder="结束日期"
                          format="yyyy-MM-dd HH:mm:ss" placeholder=""
                          range-separator="至" start-placeholder="开始日期" type="datetimerange"
                          value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <el-col :lg="12" :md="24">
        <el-form-item label="居住地" prop="habitation">
          <el-input v-model="search.criteria.habitation"
                    autocomplete="off" placeholder=""></el-input>
        </el-form-item>
      </el-col>
      <el-col :lg="12" :md="24">
        <el-form-item label="员工编号" prop="jobCode">
          <el-input v-model="search.criteria.jobCode"
                    autocomplete="off" placeholder=""></el-input>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <el-col :lg="12" :md="24">
        <el-form-item label="手机号" prop="mobile">
          <el-input v-model="search.criteria.mobile"
                    autocomplete="off" placeholder=""></el-input>
        </el-form-item>
      </el-col>
      <el-col :lg="12" :md="24">
        <el-form-item label="归属组织" prop="organizeId">
          <el-input v-model="search.criteria.organizeId"
                    autocomplete="off" placeholder=""></el-input>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <el-col :lg="12" :md="24">
        <el-form-item label="密码" prop="password">
          <el-input v-model="search.criteria.password"
                    autocomplete="off" placeholder=""></el-input>
        </el-form-item>
      </el-col>
      <el-col :lg="12" :md="24">
        <el-form-item label="真实姓名" prop="realName">
          <el-input v-model="search.criteria.realName"
                    autocomplete="off" placeholder=""></el-input>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <el-col :lg="12" :md="24">
        <el-form-item label="用户名" prop="username">
          <el-input v-model="search.criteria.username"
                    autocomplete="off" placeholder=""></el-input>
        </el-form-item>
      </el-col>
      <el-col :lg="12" :md="24">
        <el-form-item label="员工领导" prop="leaderId">
          <el-input v-model="search.criteria.leaderId"
                    autocomplete="off" placeholder=""></el-input>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <el-col :lg="12" :md="24">
        <el-form-item label="归属组织编码" prop="organizeCode">
          <el-input v-model="search.criteria.organizeCode"
                    autocomplete="off" placeholder=""></el-input>
        </el-form-item>
      </el-col>
      <el-col :lg="12" :md="24">
        <el-form-item label="员工编号" prop="jobPost">
          <el-input v-model="search.criteria.jobPost"
                    autocomplete="off" placeholder=""></el-input>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <el-col :lg="12" :md="24">
        <el-form-item label="创建者" prop="createdByName">
          <el-input v-model="search.criteria.createdByName" autocomplete="off"></el-input>
        </el-form-item>
      </el-col>
      <el-col :lg="12" :md="24">
        <el-form-item label="最后修改者" prop="modifiedByName">
          <el-input v-model="search.criteria.modifiedByName" autocomplete="off"></el-input>
        </el-form-item>
      </el-col>
      <el-col :lg="24" :md="24">
        <el-form-item label="创建时间" prop="createdDate">
          <el-date-picker v-model="search.criteria.createdDate" align="l" end-placeholder="结束日期"
                          format="yyyy-MM-dd HH:mm:ss" range-separator="至"
                          start-placeholder="开始日期" type="datetimerange" value-format="yyyy-MM-dd HH:mm:ss">
          </el-date-picker>
        </el-form-item>
      </el-col>
      <el-col :lg="24" :md="24">
        <el-form-item label="最后修改时间" prop="modifiedDate">
          <el-date-picker v-model="search.criteria.modifiedDate" align="l" end-placeholder="结束日期"
                          format="yyyy-MM-dd HH:mm:ss" range-separator="至"
                          start-placeholder="开始日期" type="datetimerange" value-format="yyyy-MM-dd HH:mm:ss">
          </el-date-picker>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <!--<el-col :md="24" :lg="24">
          <el-form-item label="备注描述" prop="remarkNote">
              <el-input type="textarea" :autosize="{minRows: 2}" v-model="search.criteria.remarkNote"autocomplete="off"></el-input>
          </el-form-item>
      </el-col>-->
      <el-col :lg="12" :md="24">
        <el-form-item label="有效状态" prop="validStatus">
          <dict-option-select v-model="search.criteria.validStatus"
                              :dictField="this.$constants.coreDict.validStatus.key"
                              autocomplete="off" placeholder=""></dict-option-select>
        </el-form-item>
      </el-col>
    </el-row>
  </el-form>
</template>

<script>
import DictOptionSelect from "@/views/system/components/DictOptionSelect";

export default {
  name: "humanUserSearch",
  model: {
    prop: 'search',
  },
  props: {
    search: {type: Object},
  },
  components: {DictOptionSelect},
  data() {
    return {
      rules: {
        avatarUrl: [
          {max: 250, message: '头像最大长度为250', trigger: ['blur', 'change']},
        ],
        cardId: [
          {max: 20, message: '身份证号最大长度为20', trigger: ['blur', 'change']},
        ],
        email: [
          {max: 50, message: '邮箱最大长度为50', trigger: ['blur', 'change']},
        ],
        expiredTime: [],
        habitation: [
          {max: 200, message: '居住地最大长度为200', trigger: ['blur', 'change']},
        ],
        jobCode: [
          {max: 20, message: '员工编号最大长度为20', trigger: ['blur', 'change']},
        ],
        mobile: [
          {max: 20, message: '手机号最大长度为20', trigger: ['blur', 'change']},
        ],
        organizeId: [
          {max: 36, message: '归属组织最大长度为36', trigger: ['blur', 'change']},
        ],
        password: [
          {max: 128, message: '密码最大长度为128', trigger: ['blur', 'change']},
        ],
        realName: [
          {max: 50, message: '真实姓名最大长度为50', trigger: ['blur', 'change']},
        ],
        username: [
          {max: 128, message: '用户名最大长度为128', trigger: ['blur', 'change']},
        ],
        leaderId: [
          {max: 36, message: '员工领导最大长度为36', trigger: ['blur', 'change']},
        ],
        organizeCode: [
          {max: 20, message: '归属组织编码最大长度为20', trigger: ['blur', 'change']},
        ],
        jobPost: [
          {max: 20, message: '员工编号最大长度为20', trigger: ['blur', 'change']},
        ],
      }
    }
  },
  methods: {
    /**表单校验回调*/
    async validate(callback) {
      return await this.$refs.userSearchForm.validate(callback)
    },
  }
}
</script>

<style lang="scss" scoped>

</style>